package com.yusys;

@SuppressWarnings("NonAsciiCharacters")
public class 求数组最大值 {
    public static void main(String[] args) {
        double[] arr = {1.0, 3.8, 9.7, 3.3};
        double max = max(arr);
        System.out.println(max);
    }

    public static double max(double[] arr) {
        double max = arr[0];
        for (double v : arr) {
            if (max < v) {
                max = v;
            }
        }
        return max;
    }
}
